Skip to content

Add type-safe execute privilege helpers for Custom APIs#17

Merged
mkholt merged 4 commits into
mainfrom
execute-privilege-name-helper-bf0
Jul 1, 2026
Merged

Add type-safe execute privilege helpers for Custom APIs#17
mkholt merged 4 commits into
mainfrom
execute-privilege-name-helper-bf0

Conversation

@mkholt

@mkholt mkholt commented Jun 30, 2026

Copy link
Copy Markdown
Member

Introduce a Privilege enum (Create/Read/Write/Delete/Append/AppendTo/ Assign/Share) and WithExecutePrivilege overloads on CustomApiConfigBuilder, resolving the platform privilege name from the entity logical name (e.g. prvReadaccount). The existing WithExecutePrivilegeName(string) remains for non-standard and non-entity-based names.

mkholt and others added 3 commits June 30, 2026 15:51
Introduce a Privilege enum (Create/Read/Write/Delete/Append/AppendTo/
Assign/Share) in the Abstractions package and WithExecutePrivilege<T>
overloads on CustomApiConfigBuilder, resolving the platform privilege
name from the entity logical name (e.g. prvReadaccount). The existing
WithExecutePrivilegeName(string) remains for non-standard names.

Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
Introduce a Privilege enum (Create/Read/Write/Delete/Append/AppendTo/
Assign/Share) and WithExecutePrivilege<T> overloads on
CustomApiConfigBuilder, resolving the platform privilege name from the
entity logical name (e.g. prvReadaccount). The existing
WithExecutePrivilegeName(string) remains for non-standard names.

The enum lives in the main package rather than Abstractions: it is
input-side sugar consumed only at build time and resolved to the
ExecutePrivilegeName string, so consumers like XrmSync/XrmMockup never
need it.

Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
…m/delegateas/XrmPluginCore into execute-privilege-name-helper-bf0

# Conflicts:
#	XrmPluginCore/CHANGELOG.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a type-safe way to configure Custom API ExecutePrivilegeName by introducing a Privilege enum and builder overloads that generate Dataverse privilege names using the prv{Privilege}{EntityLogicalName} convention.

Changes:

  • Added Privilege enum and a resolver to build standard privilege names (e.g. prvReadaccount).
  • Added WithExecutePrivilege<T>(Privilege) and WithExecutePrivilege(string, Privilege) overloads on CustomApiConfigBuilder.
  • Added unit tests covering privilege name resolution and documented the feature in the changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
XrmPluginCore/Helpers/PrivilegeNameResolver.cs Adds helper to construct standard execute privilege names from a Privilege + entity logical name.
XrmPluginCore/Enums/Privilege.cs Introduces the Privilege enum representing standard Dataverse table privileges.
XrmPluginCore/CustomApis/CustomApiConfigBuilder.cs Adds type-safe WithExecutePrivilege overloads that set ExecutePrivilegeName via the resolver.
XrmPluginCore/CHANGELOG.md Documents the new builder overloads and their behavior.
XrmPluginCore.Tests/CustomApis/CustomApiConfigBuilderTests.cs Adds coverage for name resolution and builder chaining.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread XrmPluginCore/CustomApis/CustomApiConfigBuilder.cs Outdated
Comment thread XrmPluginCore/CustomApis/CustomApiConfigBuilder.cs Outdated
Comment thread XrmPluginCore/Enums/Privilege.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread XrmPluginCore/Helpers/PrivilegeNameResolver.cs
Comment thread XrmPluginCore/CustomApis/CustomApiConfigBuilder.cs
Comment thread XrmPluginCore/CustomApis/CustomApiConfigBuilder.cs
Comment thread XrmPluginCore/Enums/Privilege.cs
The Privilege enum covers more than CRUD (Append/AppendTo/Assign/Share),
so describe the parameter as a "table privilege" rather than a "CRUD
privilege" per review feedback.

Co-Authored-By: Claude <noreply@anthropic.com> via Conducktor <conducktor@contextand.com>
@mkholt mkholt merged commit dcc1332 into main Jul 1, 2026
1 check passed
@mkholt mkholt deleted the execute-privilege-name-helper-bf0 branch July 1, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants